﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Edit.Master" AutoEventWireup="true" CodeBehind="FunctionDefinedEdit.aspx.cs" Inherits="Honestysoft.Baseframework.WebUI.SystemManage.Init.FunctionDefinedEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script language="javascript" type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
<link href="../../Styles/easyui.css" rel="stylesheet" type="text/css" />
<link href="../../Styles/icon.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
        $(function(){
	        $('#ddlParentID').combotree({                
                url:"JSON/Functions.ashx?randID="+ escape(new Date()),
                method:"get",
                enabled:false,
                onSelect:function(node){
                    document.getElementById("<%=hidParentID.ClientID %>").value=node.id;
                }
            });
        });
        var opts = null;
        function InitRules() {
            opts = {
                 rules:
                 {
                        <%=txtFuncName.UniqueID %>:{
                            required: true,
                            maxlength: 200
                        },                        
                        <%=ddlFunctionType.UniqueID %>:{
                            required: true
                        },
                        <%=txtSortCode.UniqueID %>:{
                            required: true,
                            number: true,
                            range: [0,999]
                        }
                 },
                 messages:
                 {
                        <%=txtFuncName.UniqueID %>: 
                        {
                            required:"必须输入功能名称",
                            maxlength:"最多只能输入200个字符"
                        },                       
                        <%=ddlFunctionType.UniqueID %>:{
                            required: "请选择功能类型"
                        },
                        <%=txtSortCode.UniqueID %>: 
                        {
                            required:"排序号格式错误",
                            range:"排序号是必须是介于0-999之间的数字"
                        }
                 },
                 onfocusout:false,
                 onclick:false,
                 onkeyup:false,
                 errorPlacement: function(error, element) {
                    $("#errorContainer").show();
                    error.html("<li>• "+error.html()+"</li>");
                    error.appendTo("#errorContainer");
                 },
                 wrapper:"li"
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1" style="border-bottom:0px;margin-top:2px;">
            <th style="border-bottom:0px">功能权限维护</th>
        </table>
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1">
            <tr>
                <td style="width:80px;" class="title1">功能名称</td>
                <td><asp:TextBox runat="server" ID="txtFuncName" CssClass="input1" Width="96%"></asp:TextBox></td>
                <td style="width:80px" class="title1">英文名</td>
                <td><asp:TextBox runat="server" ID="txtFuncEName" CssClass="input1" Width="96%"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width:80px" class="title1">功能类型</td>
                <td>                
                <asp:DropDownList runat="server" ID="ddlFunctionType" CssClass="input1" Width="98%"></asp:DropDownList></td>
                <td style="width:80px" class="title1">上级功能</td>
                <td><input id="ddlParentID" class="easyui-combotree" value='<%=_ParentID %>' disabled="disabled" style="width:145px">
                    
                </td>
            </tr>
            <tr>
                <td style="width:80px" class="title1">是否有效</td>
                <td align="left"><asp:CheckBox runat="server" ID="chkIsValid" /></td>
                <td style="width:80px" class="title1">排序号</td>
                <td><asp:TextBox runat="server" ID="txtSortCode" CssClass="input1" Width="96%"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width:80px" class="title1">URI</td>
                <td colspan="3"><asp:TextBox runat="server" ID="txtURI" CssClass="input1" Width="98%"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width:80px" class="title1">功能描述</td>
                <td colspan="3"><asp:TextBox runat="server" ID="txtFuncDesc" CssClass="input1" Width="98%" TextMode="MultiLine" Rows="4"></asp:TextBox></td>
            </tr>
        </table>
        <div style="text-align:center;padding:10px;">
            <asp:Button runat="server" ID="btnSave" Text="确定" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" onclick="btnSave_Click"/>
            <input type="button" id="btnNew" value="取消" onclick="javascript:window.returnValue=false;window.close();" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        </div>
         <asp:HiddenField runat="server" ID="hidFuncCode" />  
         <asp:HiddenField runat="server" ID="hidParentID" />
         <asp:HiddenField runat="server" ID="hidInitParentID" />
</asp:Content>
